package com.koron.bean.workflow;

import com.koron.bean.base.Response;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author jzp
 * @since 2021/9/7
 */
public interface WorkflowController {

    String statePath = "workflowUpdate";
    String endPath = "workflowUpdateEnd";
    String cancelPath = "workflowUpdateCancel";

    /**
     * 修改业务状态
     */
    @PostMapping(statePath)
    Response<Object> updateState(@RequestBody RedirectQuery redirectQuery);

    /**
     * 结束时的修改方法，可重写后自定义
     */
    @PostMapping(endPath)
    default Response<Object> updateEnd(@RequestBody RedirectQuery redirectQuery) {
        return updateState(redirectQuery);
    }

    /**
     * 作废时的修改方法，可重写后自定义
     */
    @PostMapping(cancelPath)
    default Response<Object> updateCancel(@RequestBody RedirectQuery redirectQuery) {
        return updateState(redirectQuery);
    }

}
